<template>
	<view class="feedback_wrap">
		<view class="feedback_item">
			<view class="title">反馈内容</view>
			<textarea class="text_area" placeholder="请输入" :value="feedback" @input="bindfeedback"></textarea>
		</view>
		<view class="bot_btn">
			<view class="btn" @click="saveFeedbackFun()">提交</view>
		</view>
	</view>
</template>

<script>
	import { saveFeedback } from '@/api/mine.js'
	export default {
		data() {
			return {
				feedback: '',
			};
		},
		onShareAppMessage(res) { //发送给朋友
			return {
				title: '小程序分享',
				imageUrl: '',
			}
		},
		methods: {
			bindfeedback(e) {
				this.feedback = e.detail.value
			},
			saveFeedbackFun() {
				if (this.feedback == '') {
					uni.showToast({
						title: '请输入反馈内容！',
						icon: 'none'
					})
					return
				}
				saveFeedback({
					content: this.feedback
				}).then(res => {
					if (res.code == 1) {
						uni.showToast({
							title: '提交成功！',
							icon: 'none'
						})
						setTimeout(() => {
							uni.navigateBack()
						},600)
					}else {
						uni.showToast({
							title: res.data.msg,
							icon: 'none'
						})
					}
				})
				
			},
		}
	}
</script>

<style lang="scss" scoped>
.feedback_wrap {
	height: 100vh;
	background: #F5F5F5;
	padding-top: 30rpx;
	.feedback_item {
		width: 690rpx;
		height: 600rpx;
		background: #FFFFFF;
		padding: 36rpx 27rpx;
		margin: 0 auto;
		border-radius: 8rpx;
		border: 1rpx solid #DDDDDD;
		.title {
			font-size: 28rpx;
			font-weight: bold;
			margin-bottom: 20rpx;
		}
		.text_area {
			font-size: 28rpx;
		}
	}
	.bot_btn {
		width: 100vw;
		height: 108rpx;
		background: #FFFFFF;
		position: fixed;
		bottom: 0;
		left: 0;
		z-index: 2;
		display: flex;
		align-items: center;
	
		.btn {
			width: 650rpx;
			height: 80rpx;
			line-height: 80rpx;
			margin: 0 auto;
			text-align: center;
			color: #fff;
			font-size: 28rpx;
			background: #1C41F1;
			border-radius: 54rpx;
		}
	}
}
</style>
